﻿// *----------------------------------------------------------------
// Copyright (C) 2017 通通优品
// 版权所有。
// 
// 类名：AsyncTaskResultOfData.cs
// 功能描述：TongTongMall.RabbitMq
// 
// Create User：jym 2017/02/09
// 
// Edit User：UserName,EditTime
// Describe：Describe
// ----------------------------------------------------------------*/
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TongTongMall.RabbitMq.IO
{
    /// <summary>
    /// 包含数据的队列返回内容
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class AsyncTaskResult<T> : AsyncTaskResult
    {

        public T Data { get; private set; }


        public AsyncTaskResult(AsyncTaskStatus status)
            : this(status, null, default(T))
        {
        }


        public AsyncTaskResult(AsyncTaskStatus status, T data)
            : this(status, null, data)
        {
        }


        public AsyncTaskResult(AsyncTaskStatus status, string errorMessage)
            : this(status, errorMessage, default(T))
        {
        }


        public AsyncTaskResult(AsyncTaskStatus status, string errorMessage, T data)
            : base(status, errorMessage)
        {
            Data = data;
        }
    }
}
